package com.zjj.learn.designmodel.pattern.factory.abstract_factory;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * *** @author zjj_admin
 * *** 2022/4/5 22:41
 */
public class AbstractFactoryTest {

    public static void main(String[] args) {

        //创建意大利风味甜品工厂对象
        ItalyDessertFactory factory = new ItalyDessertFactory();

        //AmericaDessertFactory factory = new AmericaDessertFactory();
        Coffee coffee = factory.createCoffee();
        coffee.addMilk();
        coffee.addSugar();
        Dessert dessert = factory.createDessert();
        System.out.println(coffee.getName());
        dessert.show();


        Calendar calendar = new GregorianCalendar();
        Date time = calendar.getTime();
        System.out.println("time = " + time);
    }
}
